package com.shujia.day15.ketang;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExceptionDemo3 {
    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44, 55};

//        System.out.println(arr[8]);
//        System.out.println(3/0);

        try {
//            System.out.println(arr[8]);
            System.out.println(3/0);// new ArrayIndexOutOfBoundsException()
        } catch (Exception e) { // = new ArrayIndexOutOfBoundsException()
//            System.out.println(e.getMessage());
//            System.out.println(e.toString());
            //void printStackTrace()
            //将此throwable和其追溯打印到标准错误流。
            e.printStackTrace();
        }




        System.out.println("李刚是世界首富！！");
    }
}
